package com.wangzh.network.udp.group;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;

public class SendMessage {
    public static void main(String[] args) throws IOException {
        MulticastSocket ms = new MulticastSocket();

        InetAddress address = InetAddress.getByName("224.0.0.1");
        int port = 10000;
        String aa = "nihao";
        DatagramPacket dp = new DatagramPacket(aa.getBytes(),aa.length(),address,port);
        ms.send(dp);

        ms.close();
    }
}
